import request from '@/utils/request'

export const addAmin = function(admin) {
  return request.fetchPost('/admin/user/add', admin)
}

export const getUsers = function(params) {
  return request.fetchGet('/admin/user/list', params)
}
/**
 * 添加菜单
 * @param params
 */
export const editMenu = (params) => {
  return request.fetchPost('/admin/menu/edit', params)
}

export const delMenu = (menuId) => {
  return request.fetchGet('/admin/menu/del/' + menuId, null)
}

export const getMenu = (sysmodel) => {
  return request.fetchGet('/admin/menu/getMenu/' + sysmodel, null)
}

export const getResource = (sysmodel) => {
  return request.fetchGet('/admin/resource/listBySys/', { sysmodel: sysmodel })
}

export const getRoles = () => {
  return request.fetchGet('/admin/role/list/', null)
}

export const editRole = (role) => {
  return request.fetchPost('/admin/role/edit', role)
}

export const delRole = (roleId) => {
  return request.fetchGet('/admin/role/del/' + roleId, null)
}

